@(projects: List[models.domain.Project],announcements: List[models.domain.Announcements], teacherCourses: List[models.general.vKennariHoparOnn], comments: List[models.domain.Comments],
monday: List[models.domain.TimetableHomework],tuesday: List[models.domain.TimetableHomework],wednesday: List[models.domain.TimetableHomework],thursday: List[models.domain.TimetableHomework],
friday: List[models.domain.TimetableHomework], nafn: String)
@teacherMain(title = "Forsíða") {

    <link rel="stylesheet" href="/public/stylesheets/StudentDashboard.css">
    <script src="/public/javascripts/dashboard.js"></script>
    <div class="container dashCon">
        <script>
                $(document).on("click", ".open-AddHomeworkDialog", function () {
                var myTimeslot = $(this).data('id');
                $(".modal-body #timeslot").val( myTimeslot );
                $('#addHomeworkDialog').modal('show');
                });
        </script>
        <div class="row paddingRow">
        <div class ="span6" id="test">
            <div class ="tabbable">
                <ul class="nav nav-tabs">
                    <li class ="active"><a href ="#tab1" data-toggle="tab">Mánud</a> </li>
                    <li><a href ="#tab2" data-toggle="tab">Þriðjud</a> </li>
                    <li><a href ="#tab3" data-toggle="tab">Miðvikud</a> </li>
                    <li><a href ="#tab4" data-toggle="tab">Fimmtud</a> </li>
                    <li><a href ="#tab5" data-toggle="tab">Föstud</a> </li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab1">
                        <ul class="timetable">

                            @for(record <- monday) {
                                <ul class="timetable_row stundTop">
                                <a title="Sjá/setja fyrir heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                    <div class="row-fluid">
                                        <div class="span4">
                                            @if(record.getTimeslot== 1){
                                                <li>8:30 - 9:15</li>}
                                            @if(record.getTimeslot== 2){
                                                <li>9:20 - 10:05</li>}
                                            @if(record.getTimeslot== 3){
                                                <li>10:20-11:05</li>}
                                            @if(record.getTimeslot== 4){
                                                <li>11:10-11:55</li>}
                                            @if(record.getTimeslot== 5){
                                                <li>12:20-13:05</li>}
                                            @if(record.getTimeslot== 6){
                                                <li>13:10-13:55</li>}
                                            @if(record.getTimeslot== 7){
                                                <li>14:00-14:45</li>}
                                            @if(record.getTimeslot== 8){
                                                <li>14:55-15:40</li>}
                                        </div>
                                        <div class="span3">
                                            @if(record.getNamsgrein_afanganr!=""){
                                                <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                            }else{
                                                <li></li>
                                            }
                                        </div>
                                        <div class="span3">
                                             @if(record.getNamsgrein_afanganr != ""){
                                                 <li>Stofa: @record.getStofa</li>
                                             }else{
                                                 <li></li>
                                             }
                                         </div>

                                </a>
                                <br/><br/>
                                    @if(record.getNamsgrein_afanganr != ""){
                                        <div id='@record.getId' class ="day1" style="display: none;"> Heimavinna sem þú hefur sett fyrir þennan tíma: @record.getHeimavinnaTexti <a style="float: right;" title="Bæta við heimavinnu fyrir þennan tíma" data-toggle="modal" data-id='@record.getId' data-toggle="modal" class="open-AddHomeworkDialog" href="#addHomeworkDialog"><i class="icon-plus"></i></a>  </div>
                                    }else{
                                    }


                                </ul>
                            }

                        </ul>
                        <a href="#" onclick="ShowAll('day1',1)" id="show1" class="heimavinna"> Sjá alla heimavinnu</a>
                        <a href="#" onclick="hideAll('day1',1)" id="hide1" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                    </div>
                    <div class="tab-pane" id="tab2">
                        <ul class="timetable">
                            @for(record <- tuesday) {
                                <ul class="timetable_row stundTop">
                                <a title="Sjá/setja fyrir heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                <div class="row-fluid">
                                <div class="span4">
                                    @if(record.getId== 9){
                                        <li>8:30 - 9:15</li>}
                                    @if(record.getId== 10){
                                        <li>9:20 - 10:05</li>}
                                    @if(record.getId== 11){
                                        <li>10:20-11:05</li>}
                                    @if(record.getId== 12){
                                        <li>11:10-11:55</li>}
                                    @if(record.getId== 13){
                                        <li>12:20-13:05</li>}
                                    @if(record.getId== 14){
                                        <li>13:10-13:55</li>}
                                    @if(record.getId==15){
                                        <li>14:00-14:45</li>}
                                    @if(record.getId==16){
                                        <li>14:55-15:40</li>}
                                </div>
                                <div class="span3">

                                    @if(record.getNamsgrein_afanganr!=""){
                                        <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                    }else{
                                        <li></li>
                                    }
                                </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr != ""){
                                            <li>Stofa: @record.getStofa</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                </a>
                                <br/><br/>
                                    @if(record.getNamsgrein_afanganr != ""){
                                        <div id='@record.getId' class ="day2" style="display: none;"> Heimavinna sem þú hefur sett fyrir þennan tíma: @record.getHeimavinnaTexti <a style="float: right;" title="Bæta við heimavinnu fyrir þennan tíma" data-toggle="modal" data-id='@record.getId' data-toggle="modal" class="open-AddHomeworkDialog" href="#addHomeworkDialog"><i class="icon-plus"></i></a>  </div>
                                    }else{

                                    }
                                </ul>
                            }

                        </ul>
                        <a href="#" onclick="ShowAll('day2',2)" id="show2" class="heimavinna"> Sjá alla heimavinnu</a>
                        <a href="#" onclick="hideAll('day2',2)" id="hide2" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                    </div>
                    <div class="tab-pane" id="tab3">
                        <ul class="timetable">
                            @for(record <- wednesday) {
                                <ul class="timetable_row stundTop">
                                <a title="Sjá/setja fyrir heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                <div class="row-fluid">
                                <div class="span4">
                                    @if(record.getId== 17){
                                        <li>8:30 - 9:15</li>}
                                    @if(record.getId== 18){
                                        <li>9:20 - 10:05</li>}
                                    @if(record.getId== 19){
                                        <li>10:20-11:05</li>}
                                    @if(record.getId== 20){
                                        <li>11:10-11:55</li>}
                                    @if(record.getId== 21){
                                        <li>12:20-13:05</li>}
                                    @if(record.getId== 22){
                                        <li>13:10-13:55</li>}
                                    @if(record.getId== 23){
                                        <li>14:00-14:45</li>}
                                    @if(record.getId== 24){
                                        <li>14:55-15:40</li>}
                                </div>
                                <div class="span3">
                                    @if(record.getNamsgrein_afanganr!=""){
                                        <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                    }else{
                                        <li></li>
                                    }
                                </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr != ""){
                                            <li>Stofa: @record.getStofa</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                </a>
                                    <br/><br/>
                                    @if(record.getNamsgrein_afanganr != ""){
                                        <div id='@record.getId' class ="day3" style="display: none;"> Heimavinna sem þú hefur sett fyrir þennan tíma: @record.getHeimavinnaTexti <a style="float: right;" title="Bæta við heimavinnu fyrir þennan tíma" data-toggle="modal" data-id='@record.getId' data-toggle="modal" class="open-AddHomeworkDialog" href="#addHomeworkDialog"><i class="icon-plus"></i></a>  </div>
                                    }else{

                                    }
                                </ul>
                            }

                        </ul>
                        <a href="#" onclick="ShowAll('day3',3)" id="show3" class="heimavinna"> Sjá alla heimavinnu</a>
                        <a href="#" onclick="hideAll('day3',3)" id="hide3" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                    </div>
                    <div class="tab-pane" id="tab4">
                        <ul class="timetable">
                            @for(record <- thursday) {
                                <ul class="timetable_row stundTop">
                                <a title="Sjá/setja fyrir heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                <div class="row-fluid">
                                <div class="span4">
                                    @if(record.getId== 25){
                                        <li>8:30 - 9:15</li>}
                                    @if(record.getId== 26){
                                        <li>9:20 - 10:05</li>}
                                    @if(record.getId== 27){
                                        <li>10:20-11:05</li>}
                                    @if(record.getId== 28){
                                        <li>11:10-11:55</li>}
                                    @if(record.getId== 29){
                                        <li>12:20-13:05</li>}
                                    @if(record.getId== 30){
                                        <li>13:10-13:55</li>}
                                    @if(record.getId== 31){
                                        <li>14:00-14:45</li>}
                                    @if(record.getId== 32){
                                        <li>14:55-15:40</li>}
                                </div>
                                <div class="span3">
                                    @if(record.getNamsgrein_afanganr!=""){
                                        <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                    }else{
                                        <li></li>
                                    }
                                </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr != ""){
                                            <li>Stofa: @record.getStofa</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                </a>
                                <br/><br/>
                                    @if(record.getNamsgrein_afanganr != ""){
                                        <div id='@record.getId' class ="day4" style="display: none;"> Heimavinna sem þú hefur sett fyrir þennan tíma: @record.getHeimavinnaTexti <a style="float: right;" title="Bæta við heimavinnu fyrir þennan tíma" data-toggle="modal" data-id='@record.getId' data-toggle="modal" class="open-AddHomeworkDialog" href="#addHomeworkDialog"><i class="icon-plus"></i></a>  </div>
                                    }else{

                                    }
                                </ul>
                            }

                        </ul>
                        <a href="#" onclick="ShowAll('day4',4)" id="show4" class="heimavinna"> Sjá alla heimavinnu</a>
                        <a href="#" onclick="hideAll('day4',4)" id="hide4" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                    </div>
                    <div class="tab-pane" id="tab5">
                        <ul class="timetable">
                            @for(record <- friday) {
                                <ul class="timetable_row stundTop">
                                <a title="Sjá/setja fyrir heimavinnu fyrir þennan tíma" style = "color:black" href="javascript:SlideUpSlideDownById('@record.getId');">
                                <div class="row-fluid">
                                <div class="span4">
                                    @if(record.getId==33){
                                        <li>8:30 - 9:15</li>}
                                    @if(record.getId==34){
                                        <li>9:20 - 10:05</li>}
                                    @if(record.getId==35){
                                        <li>10:20-11:05</li>}
                                    @if(record.getId==36){
                                        <li>11:10-11:55</li>}
                                    @if(record.getId==37){
                                        <li>12:20-13:05</li>}
                                    @if(record.getId==38){
                                        <li>13:10-13:55</li>}
                                    @if(record.getId==39){
                                        <li>14:00-14:45</li>}
                                    @if(record.getId==40){
                                        <li>14:55-15:40</li>}
                                </div>
                                <div class="span3">
                                    @if(record.getNamsgrein_afanganr!=""){
                                        <li>@record.getNamsgrein_afanganr - @record.getHopur_id</li>
                                    }else{
                                        <li></li>
                                    }
                                </div>
                                    <div class="span3">
                                        @if(record.getNamsgrein_afanganr != ""){
                                            <li>Stofa: @record.getStofa</li>
                                        }else{
                                            <li></li>
                                        }
                                    </div>
                                </a>
                                <br/><br/>
                                    @if(record.getNamsgrein_afanganr != ""){
                                        <div id='@record.getId' class ="day5" style="display: none;"> Heimavinna sem þú hefur sett fyrir þennan tíma: @record.getHeimavinnaTexti <a style="float: right;" title="Bæta við heimavinnu fyrir þennan tíma" data-toggle="modal" data-id='@record.getId' data-toggle="modal" class="open-AddHomeworkDialog" href="#addHomeworkDialog"><i class="icon-plus"></i></a>  </div>
                                    }else{

                                    }
                                </ul>
                            }

                        </ul>
                        <a href="#" onclick="ShowAll('day5',5)" id="show5" class="heimavinna"> Sjá alla heimavinnu</a>
                        <a href="#" onclick="hideAll('day5',5)" id="hide5" hidden ="hide" class="heimavinna"> Loka heimavinnu</a>
                    </div>
                </div>
            </div>
        </div>


            <!--Modal -->
            <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h3 id="myModalLabel">Setja inn nýja tilkynningu</h3>
                </div>
                 @helper.form(action = routes.TeacherController.uploadAnnouncements(0)){
                <div class="modal-body">
                    <div class="control-group">
                        <label class="control-label"> Áfangi </label>
                        <div class="controls">
                            <select class="input-xlarge" name="afangi_id">
                                <option value="0">Birta fyrir allan skólann</option>
                                @for(course <- teacherCourses){
                                    <option value=@{course.afangi_id}>@{course.namsgrein_afanganr}</option>
                                }
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"> Fyrirsögn </label>
                        <div class="controls">
                            <input class="input-xlarge" name="fyrirsogn">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"> Tilkynning </label>
                        <div class="controls">
                            <textarea class="input-xxlarge" name="texti"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary" value="submit">Vista tilkynningu</button>
                    <button class="btn" data-dismiss="modal" aria-hidden="true">Hætta við</button>
                </div>
                 }
            </div>
            <!--End of modal-->

                <!--modal popup AddHomework -->
            <div class="modal hide" id="addHomeworkDialog">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal">×</button>
                    <h3>Setja fyrir heimavinnu</h3>
                </div>
                @helper.form(action = routes.TeacherController.uploadHomework()){
                    <div class="modal-body">
                        <div class="control-group">
                            <label class="control-label"> Heimavinna </label>
                            <div class="controls">
                                <input class="input-xxlarge" name="texti">
                            </div>
                        </div>
                        <input type="hidden" name="timeslot" id="timeslot">
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-primary" value="submit">Staðfesta heimavinnu</button>
                        <button class="btn" data-dismiss="modal" aria-hidden="true">Hætta við</button>
                    </div>
                }
            </div>
                <!--end of modal-->

            <div class="span6">
                <div class ="tabbable">
                    <ul class="nav nav-tabs">
                        <li ><a href="allTeacherAnnouncements" class = "dashStaerri" title="Sjá allar tilkynningar">Tilkynningar</a></li>
                        <li> <a href="#myModal" data-toggle="modal" title="Bæta við tilkynningu"><i class="icon icon-plus"></i></a></li>
                    </ul>
                </div>
                <table class = "table">
                    @for(announcement <- announcements){
                        <div class="wellAnnouncementsDashboard">
                            <p class="underScore11pt">@announcement.dagur_stofnad &nbsp;&nbsp;@announcement.namsgrein_afanganr</p>
                            <p class="bold12pt">@announcement.fyrirsogn</p>
                            <p class="reg11pt">@announcement.texti</p>
                        </div>
                    }
                </table>
            </div>
    </div>

    <div class="row paddingRow">
        <div class="span6">
            <div class ="tabbable">
                <ul class="nav nav-tabs">
                    <li><a href ="@routes.TeacherController.teacherOpenAssignments()" class = "dashStaerri" title="Sjá öll verkefni">Næstu skil</a> </li>
                    <li> <a href="@routes.TeacherController.createAssignment()" title="Bæta við verkefni"><i class="icon icon-plus"></i></a></li>
                </ul>
            </div>
            <table class = "table table-striped tableNoOverflow">
                <tr>
                    <th>Áfangi</th>
                    <th>Heiti</th>
                    <th>Tegund</th>
                    <th>Skiladagur</th>
                </tr>
                @for(project <- projects){
                    <tr>
                    <td>@{project.getCourse}</td>
                    <td><a href="@{routes.TeacherController.teacherOneAssignment(project.getVerkefni_id,project.getHopur_id)}" style="color:black;"/>@{project.getName}</td>
                        @if(project.getType=="test"){
                            <td>Próf</td>
                        }
                        @if(project.getType=="project"){
                            <td>Verkefni</td>
                        }
                    <td>@{project.getHandInDate}</td>
                    </tr>
                }
            </table>
        </div>

        <div class="span6">
            <div class ="tabbable">
                <ul class="nav nav-tabs">
                    <li><a href ="@routes.TeacherController.teacherCourses(0,0)" class = "dashStaerri" title="Sjá alla áfanga">Áfangar</a> </li>
                </ul>
            </div>
            <table class = "table table-striped">
                <tr>
                    <th>Áfangi</th>
                    <th>Hópur</th>
                </tr>
                @for(course <- teacherCourses){
                    <tr>
                    <td><a href="@routes.TeacherController.teacherCourses(course.getAfangi_id,course.getHopur_id)" />@course.namsgrein_afanganr</td>
                    <td>@course.hopur</td>
                    </tr>
                }
            </table>
        </div>
    </div>

    <div class="row paddingRow">
        <div class="span12">
            <div class ="tabbable">
                <ul class="nav nav-tabs">
                    <li><a href="allTeacherDiscussions" class = "dashStaerri">Nýjustu umræður</a></li>
                </ul>
            </div>
            <ul class="discussions">
                @for(comment <- comments){
                    <li><a href="@routes.TeacherController.teacherOneAssignment(comment.getVerkefni_id,comment.getHopur_id)"style="color:black;"/>@{comment.stofnad_stengur} &nbsp;&nbsp;&nbsp;&nbsp; @{comment.getName} kom með athugasemd við verkefnið @{comment.getVerkefni_nafn} sem þú settir fyrir
                        }
            </ul>
        </div>
    </div>
</div>
}